﻿@page "/Account/My/Address-Add"
@inherits YiMeiJiaService.Assembly.BaseComponent
@using Newtonsoft.Json;
@using YiMeiJiaLibModel.Config
@using YiMeiJiaApp.Pages.Components
@using YiMeiJiaLibModel.Business
@{
    var tit = "新增地址";
}
@if (IsEditor)
{
    tit = "编辑地址";
}
<Headers MyPartialText="@tit"></Headers>


<div class="cm-app-container">
    <div class="weui-cells__title">收货人</div>
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" @bind="_ADD_address.name" placeholder="请输入收件人的姓名">
            </div>
        </div>
    </div>
    <div class="weui-cells__title">手机号</div>
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <input class="weui-input" type="number" @bind="_ADD_address.mobile" placeholder="请输入收件人的姓名">
            </div>
        </div>
    </div>
    <div class="weui-cells__title">省市区</div>
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" @bind="CityAll"  id='city-picker' @onclick="(()=>SetCity())" placeholder="请选择省市区" />
            </div>
        </div>
    </div>
    <div class="weui-cells__title">详细地址</div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <textarea class="weui-textarea" placeholder="请输入详细地址" rows="3" @bind="_ADD_address.address"></textarea>
                <div class="weui-textarea-counter"><span>0</span>/200</div>
            </div>
        </div>
    </div>
    <div class="weui-cell weui-cell_switch">
        <div class="weui-cell__bd">设为默认</div>
        <div class="weui-cell__ft">
            <label for="switchCP" class="weui-switch-cp">
                <input id="switchCP" class="weui-switch-cp__input"  type="checkbox" checked="checked">
                <div class="weui-switch-cp__box"></div>
            </label>
        </div>
    </div>
</div>

<div class="flex-container-btn cm-txt-center">
    <a href="javascript:;" class="weui-btn   weui-btn_warn" @onclick="SaveAddress">确认添加</a>
</div>
<script src="@ApiConf.ApiStatic()/js/city-picker.js"></script>
<script>
    $(function () {
        $("#shop-tabbar").slideToggle(2000);

        $("#city-picker").cityPicker({
            title: "请选择收货地址"
        });
    })

</script>
@code {

}
